package com.boat.ai.rag.Ingestion;

import dev.langchain4j.data.document.Document;
import dev.langchain4j.data.document.splitter.DocumentBySentenceSplitter;
import dev.langchain4j.data.segment.TextSegment;

import java.util.List;


public class SentenceSplitter implements Split {

    @Override
    public List<TextSegment> split(List<Document> documents) {
        DocumentBySentenceSplitter splitter = new DocumentBySentenceSplitter(200, 20); // 200 tokens, overlap of 20
        return splitter.splitAll(documents);
    }
}
